import { FC, useState } from 'react';
import styles from './list.module.scss';
import QuestionCard from '../../components/question/questionCard';

const data = [
  {
    _id: 'q1',
    title: '问卷1',
    isPublished: true,
    isStar: true,
    answer: 5,
    createAt: '1月15',
  },
  {
    _id: 'q2',
    title: '问卷2',
    isPublished: true,
    isStar: true,
    answer: 5,
    createAt: '1月15',
  },
  {
    _id: 'q3',
    title: '问卷3',
    isPublished: true,
    isStar: false,
    answer: 5,
    createAt: '1月15',
  },
  {
    _id: 'q4',
    title: '问卷4',
    isPublished: false,
    isStar: false,
    answer: 5,
    createAt: '1月15',
  },
];

const Header: FC = () => {
  return (
    <div className={styles.header}>
      <div className={styles.left}>
        <h3>我的问卷</h3>
      </div>
      <div className={styles.right}>搜索</div>
    </div>
  );
};

const List: FC = () => {
  const [list] = useState(data);

  return (
    <div>
      <Header />
      <div className={styles.containt}>
        {list.map((item) => (
          <QuestionCard key={item._id} {...item} />
        ))}
      </div>
      <div className={styles.footer}>footer</div>
    </div>
  );
};

export default List;
